package lc.oa;

import android.app.Application;
//import dagger.ObjectGraph;
import androidx.annotation.VisibleForTesting;
import androidx.multidex.MultiDexApplication;

import javax.inject.Inject;

import dagger.android.AndroidInjector;
import dagger.android.DaggerApplication;
import lc.oa.data.LoginRepository;
import lc.oa.data.model.LoggedInUser;
import lc.oa.di.DaggerAppComponent;
import lc.oa.exception.CrashHandler;

public class App    extends MultiDexApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        //appComponent= DaggerAppComponent.builder().appModule(new AppModule()).build();
        CrashHandler handler = CrashHandler.getInstance();
        Thread.setDefaultUncaughtExceptionHandler(handler);
    }

//    @Override
//    protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
//       return DaggerAppComponent.builder().application(this).build();
//    }
    private static LoggedInUser loggedInUser;

    public static void setLoggedInUser(LoggedInUser loggedInUser) {
        App.loggedInUser = loggedInUser;
    }

    public static LoggedInUser getLoggedInUser() {
        return loggedInUser;
    }
}
